//
//  SecondCollectionCell.m
//  Protect -A
//
//  Created by 付剑英 on 16/6/18.
//  Copyright © 2016年 付剑英. All rights reserved.
//

#import "SecondCollectionCell.h"
#import "baseLabel.h"
#import "baseImageView.h"
#import  <Masonry.h>
@interface SecondCollectionCell ()

@property (nonatomic,retain)baseLabel *labelname;
@property (nonatomic,retain)baseImageView *imageview;

@end

@implementation SecondCollectionCell

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self create];
    }
    return self;
}

-(void)create{
  
    self.labelname = [[baseLabel alloc]init];
    [self.contentView addSubview:self.labelname];
    
    self.imageview = [[baseImageView alloc]init];
    [self.contentView addSubview:self.imageview];
    
    self.labelname.backgroundColor = [UIColor redColor];
    self.imageview.backgroundColor = [UIColor blueColor];



}

-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    
    [_imageview mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.left.mas_equalTo(self.contentView).offset(0);
        
        make.right.mas_equalTo(self.contentView).offset(0);
        make.height.mas_equalTo(100);
    }];
    
    [_labelname mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(_imageview.mas_bottom).offset(0);
        make.left.mas_equalTo(self.contentView).offset(5);
        make.right.mas_equalTo(self.contentView).offset(-5);
        make.height.mas_equalTo(20);
    }];




}



@end
